#include<string>
#include<unordered_map>
using namespace std;

string minWindow(string s, string t) {
    int hash1[128] = { 0 }, hash2[128] = { 0 };
    int len = 0;
    for (auto& x : t)
        if (hash1[x]++ == 0)
            len++;
    int minlen = INT_MAX, begin = -1;
    for (int left = 0, right = 0, count = 0; right < s.size(); right++)
    {
        hash2[s[right]]++;
        if (hash2[s[right]] == hash1[s[right]]) count++;
        while (count == len)
        {
            if (right - left + 1 < minlen)
            {
                minlen = right - left + 1;
                begin = left;
            }
            if (hash2[s[left]] == hash1[s[left]]) count--;
            hash2[s[left]]--;
            left++;
        }
    }
    if (begin == -1) return "";
    else return s.substr(begin, minlen);
}

int main()
{
	/*unordered_map<char, int> hash1, hash2;
	hash1['a']++;
	hash1['a']++;
	hash2['a']++;
	if(hash1 >= hash2)*/

	string ret;
	if (ret == "") ret += 'a';
    minWindow("ADOBECODEBANC", "ABC");

	return 0;
}